import request from '@/utils/request';

const PRE_URL = '/abtest';

/**
 * 添加测试
 * @param {*} params
 */
export async function addTest(params) {
  return request(`${PRE_URL}/add`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

/**
 * 删除测试
 * @param {Long} id 测试Id
 */
export async function delTest(id) {
  return request(`${PRE_URL}/del`, {
    method: 'POST',
    data: id,
  });
}

/**
 * 修改信息
 * @param {*} params
 */
export async function editTest(params) {
  return request(`${PRE_URL}/edit`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

/**
 * 查询
 * @param {*} params
 */
export async function queryTest(params) {
  return request(`${PRE_URL}/getByPage`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

/**
 * 修改状态
 * @param {*} params
 */
export async function changeStatus(params) {
  return request(`${PRE_URL}/changeStatus`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
